URL = "http://www.winimage.com/zLibDll/unzip%(VERSION)s.zip"
VERSIONS = ["11"]
DEFAULT_VERSION = "11"
DEPENDS = ["zlib"]

# Windows: self created CMakeLists.txt created 
# Linux: Standard ConfigureMakeBuilder, not yet tested

import os, shutil, subprocess, sys
from source.builders import CMakeBuilder, ConfigureMakeBuilder

def getminizipdir(machine, directories):
  return directories.enviro+"/"+"unzip"+version

class MinizipBuilder( CMakeBuilder ):
  """ subclass of CMakeBuilder with custom configure step """

  def configure(self):
    """upgrade the files and build the solution """
    self.copyfile(sys.path[0]+"/library/additions/minizip/CMakeLists.txt", self.extractedpath)
    self.zipenv = os.environ
    self.zipenv['ZLIB_DIR'] = self.dependencies["zlib"].targetpath()
    CMakeBuilder.configure(self)

  def make_devenv(self):
    self.debug=False; CMakeBuilder.make_devenv(self)
    self.debug=True; CMakeBuilder.make_devenv(self)
   
BUILDER = MinizipBuilder


